import { NgModule, OnInit, Output } from '@angular/core'
import { RouterModule, Routes, Router } from '@angular/router'

import { LoginComponent } from './login.component'
import { ProjectsComponent } from './projects.component'
import { ProjectEditComponent } from './project-edit.component'
import { TasksComponent } from './tasks.component'
import { TaskEditComponent } from './task-edit.component'
import { UsersRankComponent } from './users-rank.component'
import { DailyComponent } from './daily.component';

const routes: Routes = [
  { path: '', redirectTo: '/projects', pathMatch: 'full' },
  { path: 'login', component: LoginComponent },
  { path: 'projects', component: ProjectsComponent },
  { path: 'projects/:project_id', component: ProjectEditComponent },
  { path: 'projects/:project_id/tasks/:task_id', component: TaskEditComponent },
  { path: 'tasks/:task_id', component: TaskEditComponent },
  { path: 'tasks', component: TasksComponent },
  { path: 'users/:user_id/tasks', component: TasksComponent },
  { path: 'users/rank', component: UsersRankComponent },
  { path: 'daily', component: DailyComponent },
]

@NgModule({
  imports: [ RouterModule.forRoot(routes) ],
  exports: [ RouterModule ]
})
export class AppRoutingModule {
}
